package com.tofacebook.reflection.model;

public class Emp {

    private Long empId;
    public String empName;
    private Integer age;
    public Character sex;

    public Emp() {
        System.out.println("调用无参构造方法将我自己实例化");
    }

    public Emp(Long empId, String empName, Integer age, Character sex) {
        this.empId = empId;
        this.empName = empName;
        this.age = age;
        this.sex = sex;
    }

    public Long getEmpId() {
        return empId;
    }

    public void setEmpId(Long empId) {
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Character getSex() {
        return sex;
    }

    public void setSex(Character sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Emp{" +
                "empId=" + empId +
                ", empName='" + empName + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }

    //写一个私有的有参构造方法
    private Emp(String empName, Integer age) {
        this.empName = empName;
        this.age = age;
    }

    //自定义的方法
    public String getEmpNameByName(String empName){
        System.out.println(empName);
        return empName;
    }

    //自定义的方法
    private void getName(){

        System.out.println("通过反射的方式可以调用私有的方法");
    }

    //私有有参的方法
    private void queryEmpId(int empId){
        System.out.println("要查询的员工id为："+empId);
    }
}
